package com.luoqy.speedy.common.execute;

import java.io.File;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.luoqy.speedy.common.ConfigManage;
import com.luoqy.speedy.core.cache.CacheServiceImpl;
import com.luoqy.speedy.util.SendEamil;


/**
 * @author lumberer
 * @date 2020年6月30日
 *   初始化执行工具
 */
@Component
public class Initialize implements CommandLineRunner{
	
	@Override
	public void run(String... args) throws Exception {
		// TODO Auto-generated method stub
		
		SendEamil.send();
		CacheServiceImpl cache=new CacheServiceImpl();
		cache.putCache("jdbc",ConfigManage.findProperties("jdbc"), 0);
		String filePath = System.getProperty("user.dir")+ File.separator+"config"+File.separator+"jdbc.properties";
		File file=new File(filePath);
		System.err.println(file.exists());
		if(!file.exists()){
			System.err.println("没有文件存在");
			file.createNewFile();
		}
		//jdbcConfigPath
		//System.getProperty("user.dir")+ "/config/"
	}

}
